/*
** my_str_isupper.c for my_str_isupper in /home/nadali_t//local/piscine/Jour_06/ex_13
** 
** Made by thomas nadalie
** Login   <nadali_t@epitech.net>
** 
** Started on  Mon Oct  8 16:24:44 2012 thomas nadalie
** Last update Mon Nov 19 16:49:19 2012 thomas nadalie
*/

#include	"my.h"

int		my_str_isupper(char *str)
{
  int		i;
  int		upper;
  int		other;

  i = 0;
  upper = 0;
  other = 0;
  while (str[i])
    {
      if (str[i] >= 'A' && str[i] <= 'Z')
	{
	  upper = upper + 1;
	  if (upper == my_strlen(str))
	    return (1);
	}
      else if (!(str[i] <= 'A' && str[i] >= 'Z'))
	{
	  other = other + 1;
	  if (other != 0)
	    return (0);
	}
      i = i + 1;
    }
  return (2);
}
